/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 * No deletion without permission, or be held responsible to law.
 * @author YDZ
 */
import { defHttp } from '/@/utils/http/axios';
import { useGlobSetting } from '/@/hooks/setting';
import { BasicModel, Page } from '../model/baseModel';

const { adminPath } = useGlobSetting();

export interface ScOrder extends BasicModel<ScOrder> {
  code?: string; // 订单号
  ddate?: string; // 订单日期
  sortNum?: number; // 订单行号
  workShopCode?: string; // 归属车间
  invCode?: string; // 存货编码
  iqty?: number; // 数量
  planStartDate?: string; // 计划开始
  planOverDate?: string; // 计划结束
  planStartDateWork?: string; // 计划开始(车间安排)
  planOverDateWork?: string; // 计划结束(车间安排)
  sumFpQty?: number; // 累计分配数
  fpStatus?: string; // 分配结果
  sumOverQty?: number; // 完工数
  sumOkQty?: number; // 合格数
  erpMoid?: string; // U8_MOID
  erpModid?: string; // U8_MODID
  orderStatus?: string; // 订单状态
}

export const scOrderList = (params?: ScOrder | any) =>
  defHttp.get<ScOrder>({ url: adminPath + '/mo/order/scOrder/list', params });

export const scOrderListData = (params?: ScOrder | any) =>
  defHttp.post<Page<ScOrder>>({ url: adminPath + '/mo/order/scOrder/listData', params });

export const scOrderForm = (params?: ScOrder | any) =>
  defHttp.get<ScOrder>({ url: adminPath + '/mo/order/scOrder/form', params });

export const scOrderSave = (params?: any, data?: ScOrder | any) =>
  defHttp.postJson<ScOrder>({ url: adminPath + '/mo/order/scOrder/save', params, data });

export const scOrderDelete = (params?: ScOrder | any) =>
  defHttp.get<ScOrder>({ url: adminPath + '/mo/order/scOrder/delete', params });

export const scOrderAdjust = (params?: ScOrder | any) =>
  defHttp.get<ScOrder>({ url: adminPath + '/mo/order/scOrder/adjust', params });
